// middleware.ts
// import {NextRequest, NextResponse} from "next/server";
// import middleware from "next-auth/middleware";
export {default} from "next-auth/middleware";

// 中间件, 防止未登录用户访问受保护路由
// export function middleware(req: NextRequest) {
//     // 重定向到redirect
//     return NextResponse.redirect(new URL('/redirect', req.url))
// }

// 未登录会跳转到登录页
// export default middleware

export const config = {
    // 哪些路由被保护
    // 还可以用*, +, ?
    matcher: ['/users/:id*']
}
